<template>
  <view class="message">
    <NavBar title="消息中心" :left="false" right="clean"/>
		<view class="content">
			<view class="message-list">
				<view class="message-item" v-for="item in 1" :key="item">
					<view class="user-info">
						<view class="user-avatar">
							<image src="/static/icon/login/logo.png" class="avatar" />
						</view>
						<view class="user-details">
							<view class="user-name"> 黄师傅 </view>
							<view class="user-msg"> 黄师傅，你现在到哪里了？ </view>
						</view>
					</view>
					<view class="time"> 19:00 </view>
				</view>
			</view>
		</view>
		<TabBar :currentPage="1" />
  </view>
</template>

<script setup>
	import { ref } from 'vue'
	import { onLoad, onBackPress } from '@dcloudio/uni-app'
	import TabBar from '@/components/TabBar.vue'
	import NavBar from '@/components/NavBar.vue'
	onLoad(() => {
		uni.hideTabBar()
	})
  onBackPress((e) => {
    if(e.from == 'backbutton') return uni.switchTab({ url: '/pages/index/index' })
  })
</script>

<style lang="scss" scoped>
	
	.message {
		padding-bottom: 60px;
		.content {
			padding: 10px 12px;
			.message-list {
				// padding: 0 10px;
				border-radius: 10px;
				background-color: #fff;
				.message-item {
					height: 70px;
					padding: 13px 10px;
					display: flex;
					justify-content: space-between;
					box-sizing: border-box;
					position: relative;
					&::before {
						display: block;
						content: '';
						width: calc(100% - 70px);
						height: 1px;
						background: #E7E7E7;
						position: absolute;
						bottom: 0;
						left: 60px;
					}
					&:nth-last-of-type(1) {
						&::before {
							display: none;
						}
					}
					.user-info {
						display: flex;
						align-items: center;
						.user-avatar {
							.avatar {
								width: 44px;
								height: 44px;
								margin-right: 8px;
								border-radius: 100%;
							}
						}
						.user-details {
							.user-name {
								font-weight: 500;
								font-size: 17px;
								color: #222222;
								line-height: 24px;
							}
							.user-msg {
								font-weight: 400;
								font-size: 14px;
								color: #999999;
								line-height: 20px;
							}
						}
					}
					.time {
						font-weight: 400;
						font-size: 14px;
						color: #999999;
						line-height: 20px;
					}
				}
			}
		}
	}
</style>
